package com.wang.example.netty.handler.server;

import com.wang.basic.netty.handler.Message;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelOutboundHandlerAdapter;
import io.netty.channel.ChannelPromise;

public class EchoServerOutHandler2 extends ChannelOutboundHandlerAdapter{

    @Override
    public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
        System.out.println("EchoServerOutHandler2 处理："+msg);
        Message message = (Message) msg;
        message.setTime(System.currentTimeMillis());
        ctx.channel().writeAndFlush(msg, promise);
    }
}
